Blue roses

2019-08-10 22:59:18

Here are the results of a little experiment I programmed in Java. The program reads in a JPEG image, extracts the RGB (red green blue) data from each pixel, and converts this data to HSB format (hue saturation brightness). These operations are done by built-in Java libraries, which is why I chose that language for this experiment. My program then played with the hue or saturation data before reassembling and saving the image.

The first experiment replaces red hues by blue, leaving all other pixels untouched, and leaving saturation and brightness information unchanged for every pixel. A related experiment replaced green by blue.

The last experiment left hues untouched, but upped the saturation of any pixel with a reddish hue. The results are roses that are a darker, richer pink.

The first image below is the original photo, taken in June of 2018 in southeast Portland, Oregon.

On edit: A friend told me about a German expression referring to a blue rose as a symbol of something longed-for but unattainable. (I already knew that blue roses are impossible due to the lack of a blue pigment in that plant family.) He also said that Photoshop has functions for doing the kind of manipulations I show here, and in fact, these are designed to avoid edge effects of a sort visible in the blue rose image on the right edge of the frame (a small patch of blue has an unnatural edge due to my algorithm not handling a gradual change of hue gracefully).